Public Class SessionExpired
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents lblInfo As System.Web.UI.WebControls.Label

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Const AUTH_COOKIE_EXPIRED_STR As String = "<h3>Warning:</h3><h4>Page has expired</h4>Please close this window and return to main page"

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            ' source = 1: from dialog
            If IsNothing(Request.QueryString("source")) Then
                Server.ClearError()
                Response.Redirect(Config.AppRoot & "/Login.aspx?ReturnUrl=" & Server.UrlEncode(Request.UrlReferrer.PathAndQuery))
            Else
                If CInt(Request.QueryString("source")) = 1 Then
                    Me.lblInfo.Text = Me.AUTH_COOKIE_EXPIRED_STR
                End If
            End If
        End If
    End Sub

End Class
